package com.zynn.service.module.es.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.zynn.service.module.es.bo.DegOneFrientWithWeight;
import com.zynn.service.module.es.entity.BlendBaseUserCache;
import com.zynn.service.module.es.entity.ProductBaseUserCache;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 刘猛
 * @since 2018-10-09
 */
@Mapper
public interface BlendBaseUserCacheMapper extends BaseMapper<BlendBaseUserCache> {

void insertBlendBaseRecommendUsers2CacheTableDegOne(@Param("sequenceId") Long sequenceId, @Param("userId") Long userId);


void insertBlendBaseRecommendUsers2CacheTable(@Param("userId") Long userId,@Param("sequenceId") Long sequenceId, @Param("sequenceIdUp") Long sequenceIdUp);

/**
 * 查询缓存表用户
 * @param sequenceId
 * @return
 */
Set<Long> queryDegfriends(@Param("sequenceId") Long sequenceId);

/**
 * 查询学校权重好友
 * @param userId
 * @param sequenceId
 * @param degScore
 * @return
 */
List<DegOneFrientWithWeight> querySchoolWeightFriends(@Param("userId") Long userId,@Param("sequenceId") Long sequenceId,@Param("degScore") int degScore);


/**
 * 查询操作推荐用户
 * @param userId
 * @param sequenceId
 * @return
 */
List<DegOneFrientWithWeight> queryHandleWeightFriends(@Param("userId") Long userId,@Param("sequenceId") Long sequenceId,@Param("sequenceDegUp") Long sequenceDegUp);

}
